<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title></title>
	<link rel="stylesheet" type="text/css" href="/css/style.css">
</head>

<body>


	<%- include ('header.ejs') %>

	<div class="box">
		<ul class="news">
			<% for(let i=0;i<articles.length;i++){ %>

			<li>
				<div class="uinfo">
					<a href="#">
						<img src="/img/<%-articles[i].user.avatar%>">
						<div> <%- articles[i].user.username %> </div>
					</a>
				</div>

				<div class="cbox">
					<div class="content">
						<p class="tbox">
							<a href="/comment/info/<%= articles[i]._id %> "> <%- articles[i].title %> </a>
							<% if(user){%>
							<%if(user.username==articles[i].user.username){ %>
							<a href="/article/deleteArticle/<%= articles[i]._id %> " class="del_btn">
								删除
							</a>
							<% } %>
							<% }%>

						</p>
						<p>
							<a href="/comment/info/<%= articles[i]._id %>">
								<%- articles[i].content %>
							</a>
						</p>
					</div>
					<div>
						<span>浏览(10)</span>
						<span>
							<a href="/comment/info/<%= articles[i]._id %>">评论(8)</a>
						</span>
						<% if(user){ %>
						<span>
							<a href="#">点赞(10)</a>
						</span>
						<% } %>
						<span>收藏(10)</span>
					</div>
				</div>
			</li>

			<% } %>
		</ul>
	</div>
</body>

</html>